package com.example.oj.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.oj.entity.Competition;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.oj.entity.dto.competition.CompetitionQueryRequest;
import com.example.oj.entity.dto.competition.CompetitionSaveRequest;
import com.example.oj.entity.vo.CompetitionVO;
import com.example.oj.entity.vo.QuestionVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 28651
* @description 针对表【competition】的数据库操作Service
* @createDate 2024-03-18 20:43:01
*/
public interface CompetitionService extends IService<Competition> {

    /**
     * 获取比赛列表
     * @param queryRequest
     * @return
     */
    List<Competition> getCompetitionPage(CompetitionQueryRequest queryRequest);

    /**
     * 获取比赛列表的封装
     * @param questionPage
     * @return
     */
    Page<CompetitionVO> getCompetitionVOPage(Page<Competition> questionPage);

    /**
     * 将实体转换为VO
     */
    public CompetitionVO getCompetitionVO(Competition competition);

    /**
     * 根据竞赛Id获取题目列表
     * @param id
     * @return
     */
    List<QuestionVO> getQuestionListByCid(Long id);


    Integer saveCompetition(CompetitionSaveRequest data, HttpServletRequest request);

    Integer deleteCompetition(Long id);

  Integer updateCompetitionState(Long id, Integer state);
}
